package 历年真题;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Scanner;

/**
 * Created by stevenfen on 2017/3/25.
 */
public class q24 {

    /**
     * 计算两个日期之间的天数间隔
     * @param startDate
     * @param endDate
     * @return
     * @throws ParseException
     */
    private static int dayBetween(String startDate,String endDate) throws ParseException {

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(simpleDateFormat.parse(startDate));
        long startTimeLine = calendar.getTimeInMillis();

        calendar.setTime(simpleDateFormat.parse(endDate));
        long endTimeLine = calendar.getTimeInMillis();

        return (int)Math.abs((endTimeLine-startTimeLine)/(1000*3600*24));
    }

    public static void main(String[] args) throws ParseException {

        Scanner scanner = new Scanner(System.in);
        System.out.println(dayBetween(scanner.nextLine(),"1949-10-1"));
    }
}
